package com.cheer.tool;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;

import java.util.List;

public class VoteSortTool {


    /**
     * 通过读取顺序ID
     * @param args
     */
    public static void main(String[] args) {

        // 读取顺序ID
        List<String> strings = FileUtil.readUtf8Lines("C:\\Users\\Administrator\\Desktop\\青年文明号.txt");
        for (int i = 1; i <strings.size()+1; i++) {

            String lines = StrUtil.trim(strings.get(i- 1));
            Integer integer = new Integer(i);
            String number = "";
            if(integer.toString().length() == 1){
                number = "000"+integer;
            }else if (integer.toString().length() == 2){
                number = "00"+integer;
            }else{
                number = "0"+integer;
            }
            String updateStr = "UPDATE `xdxx`.`ex_vote_person` SET `person_number`='"+number+"' WHERE (`id`='"+lines+"');";
            System.out.println(updateStr);
        }

    }


}
